﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace MethodWorx.CMS.Plugins.ContentTree
{
    public interface IContentTreePlugin : IAutoLoadedPlugin
    {
        IEnumerable<TreeNode> GetTreeNodes(string objectType, Guid? objectId);
        ActionResult InvokeAction(string action, string objectType, Guid? objectId);
    }

    public static class IContentTreePluginExtensions
    {
        public static bool IsRootNode(this IContentTreePlugin src, string objectType, Guid? objectId)
        {
            return string.IsNullOrEmpty(objectType) && objectId == null;
        }
    }
}
